<template>
  <el-dialog title="查看" :close-on-click-modal="false" :visible.sync="visible" class="view" center>
    <div>
     
      <p>
        <span>缩略图</span>:
        <span>
          <img :src="bannerUrl" style="width: 40px; height: 40px;vertical-align: middle;">
        </span>
      </p>
       <p>
        <span>url地址</span>:
        <span>{{bannerLink}}</span>
      </p>
      <p>
        <span>排序编号</span>:
        <span>{{bannerType}}</span>
      </p>
      <p>
        <span>状态</span>:
        <span v-if="isAlive==1">启用</span>
        <span v-else>禁用</span>
      </p>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false" style="text-align:center">返回</el-button>
    </span>
  </el-dialog>
</template>
<style>
.inline {
  display: inline;
}
.types div {
  display: inline;
}
</style>

<script>
export default {
  data() {
    return {
      visible: false,
      bannerUrl: "",
      bannerType: "",
      bannerLink: "",
      isAlive:'',
    };
  },
  methods: {
    init(id) {
      this.id = id || 0;
      this.visible = true;
      this.$nextTick(() => {
        // this.$refs["dataForm"].resetFields();
        // if (this.dataForm.id) {
        this.$http({
          url: this.$http.adornUrl(`/operate/bannerinfo/see/${this.id}`),
          method: "get",
          params: this.$http.adornParams()
        }).then(({ data }) => {
          if (data && data.code === 0) {
            this.bannerUrl = data.bannerInfo.bannerUrl;
            this.bannerType = data.bannerInfo.bannerType;
            this.bannerLink = data.bannerInfo.bannerLink;
            this.isAlive = data.bannerInfo.isAlive;
          }
        });
        // }
      });
    }
  }
};
</script>
